package manager;

import idao.IBrandsDao;
import imanager.IBrandsManager;

import java.util.List;

import model.Brands;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;



@Service
public class BrandsManager implements IBrandsManager {

	@Autowired
	private IBrandsDao brandsDao;

	public IBrandsDao getBrandsDao() {
		return brandsDao;
	}

	public void setBrandsDao(IBrandsDao brandsDao) {
		this.brandsDao = brandsDao;
	}

	public BrandsManager() {
		// TODO Auto-generated constructor stub
	}

	@Transactional
	public boolean insert(Brands brands) {
		// TODO Auto-generated method stub
		return brandsDao.insert(brands);
	}

	@Transactional
	public boolean update(Brands brands) {
		// TODO Auto-generated method stub
		return brandsDao.update(brands);
	}

	@Transactional
	public boolean delete(Brands brands) {
		// TODO Auto-generated method stub
		return brandsDao.delete(brands);
	}

	@Transactional
	public Brands getBrandByID(int id) {
		// TODO Auto-generated method stub
		return brandsDao.getBrandByID(id);
	}

	@Transactional
	public List<Brands> getAll() {
		// TODO Auto-generated method stub
		return brandsDao.getAll();
	}

}
